package com.controller.zk;

import com.bean.zk.Emp;
import com.dao.zk.IndexPowerDAO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@Controller
public class IndexPwerController {

    @Resource
    private IndexPowerDAO indexPowerDAO;

    @RequestMapping(value = "/getcuruser")
    @ResponseBody
    public Map<String, Object> getUser(HttpServletRequest request){
        Map<String, Object> user = (Map<String, Object>)request.getSession().getAttribute("user");
        return user;
    }
    @RequestMapping(value = "/getcuruser_power/{eid}")
    @ResponseBody
    public List<Map<String, Object>> getUser(@PathVariable String eid){
        List<Map<String, Object>> urls = indexPowerDAO.selUrlByEid(Integer.parseInt(eid));
        return urls;
    }
}
